package topo.data;

import com.zhtelecom.common.base.Utils;
import java.io.Serializable;

public class NodeLink implements Serializable {
    private String linkName = "linkName";

    private String fromNode = "";

    private int fromPhysicalPort = -1;

    private int fromNodeIfIndex = -1;

    private String fromNodeIfName = "";

    private String toNode = "";

    private int toPhysicalPort = -1;

    private int toNodeIfIndex = -1;

    private String toNodeIfName = "";

    private String linkType = "";

    private long linkBandwidth = 0L;

    private String linkDesc = "";

    public String toString() {
        return getLinkDesc();
    }

    public String genKey() {
        String index = this.fromNode + "_" + this.fromPhysicalPort + "->" + this.toNode + "_" + this.toPhysicalPort;
        return Utils.getMD5IDKey(index);
    }

    public boolean equals(Object obj) {
        if ((obj instanceof NodeLink)) {
            NodeLink theDBkey = (NodeLink) obj;
            if (getLinkName().equals(theDBkey.getLinkName())) {
                return true;
            }
        }
        return false;
    }

    public int hashCode() {
        return this.linkName.hashCode();
    }

    public String getLinkDesc() {
        return this.linkDesc;
    }

    public String getLinkName() {
        return this.linkName;
    }

    public String getLinkType() {
        return this.linkType;
    }

    public void setLinkDesc(String linkDesc) {
        this.linkDesc = linkDesc;
    }

    public void setLinkName(String linkName) {
        this.linkName = linkName;
    }

    public void setLinkType(String linkType) {
        this.linkType = linkType;
    }

    public String getFromNode() {
        return this.fromNode;
    }

    public void setFromNode(String fromNode) {
        this.fromNode = fromNode;
    }

    public String getToNode() {
        return this.toNode;
    }

    public void setToNode(String toNode) {
        this.toNode = toNode;
    }

    public int getFromNodeIfIndex() {
        return this.fromNodeIfIndex;
    }

    public void setFromNodeIfIndex(int fromNodeIfIndex) {
        this.fromNodeIfIndex = fromNodeIfIndex;
    }

    public int getFromPhysicalPort() {
        return this.fromPhysicalPort;
    }

    public void setFromPhysicalPort(int fromPhysicalPort) {
        this.fromPhysicalPort = fromPhysicalPort;
    }

    public int getToNodeIfIndex() {
        return this.toNodeIfIndex;
    }

    public void setToNodeIfIndex(int toNodeIfIndex) {
        this.toNodeIfIndex = toNodeIfIndex;
    }

    public int getToPhysicalPort() {
        return this.toPhysicalPort;
    }

    public void setToPhysicalPort(int toPhysicalPort) {
        this.toPhysicalPort = toPhysicalPort;
    }

    public long getLinkBandwidth() {
        return this.linkBandwidth;
    }

    public void setLinkBandwidth(long linkBandwidth) {
        this.linkBandwidth = linkBandwidth;
    }

    public String getFromNodeIfName() {
        return this.fromNodeIfName;
    }

    public void setFromNodeIfName(String fromNodeIfName) {
        this.fromNodeIfName = fromNodeIfName;
    }

    public String getToNodeIfName() {
        return this.toNodeIfName;
    }

    public void setToNodeIfName(String toNodeIfName) {
        this.toNodeIfName = toNodeIfName;
    }
}